home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / subeqn / subeqnarray.doc (.txt) < prev    next >
LaTeX Document  |  1993-11-01  |  8KB  |  162 lines

  1. %%% ====================================================================
  2. %%%  @LaTeX-style-file{
  3. %%%     author          = "Braams J.L.",
  4. %%%     version         = "2.0",
  5. %%%     date            = "02 November 1993",
  6. %%%     time            = "15:06:16 MET",
  7. %%%     filename        = "subeqnarray.doc",
  8. %%%     address         = "PTT Research
  9. %%%                        St. Paulusstraat 4
  10. %%%                        2264 XZ Leidschendam
  11. %%%                        The Netherlands",
  12. %%%     telephone       = "(70) 3325051",
  13. %%%     FAX             = "(70) 3326477",
  14. %%%     checksum        = "23077 186 688 7602",
  15. %%%     email           = "J.L.Braams@research.ptt.nl (Internet)",
  16. %%%     codetable       = "ISO/ASCII",
  17. %%%     keywords        = "",
  18. %%%     supported       = "yes",
  19. %%%     abstract        = "This style option defines the subeqnarray
  20. %%%                        and subeqnarray* environments, which behave
  21. %%%                        like the eqnarray environment, except that
  22. %%%                        the lines are numbered like 1a 1b 1c etc.
  23. %%%                        To refer to these numbers an extra label
  24. %%%                        command \slabel has been defined
  25. %%%                        The equations and their numbers adhere to
  26. %%%                        the standard LaTeX options leqno and fleqn.",
  27. %%%     docstring       = "The checksum field above contains a CRC-16
  28. %%%                        checksum as the first value, followed by the
  29. %%%                        equivalent of the standard UNIX wc (word
  30. %%%                        count) utility output of lines, words, and
  31. %%%                        characters.  This is produced by Robert
  32. %%%                        Solovay's checksum utility.",
  33. %%%  }
  34. %%% ====================================================================
  35. %\iffalse
  36. % Subeqnarray DOCUMENT-STYLE option -- Version 1.1 released 15 November 1988
  37. %                                      Version 2.0 released  2 November 1993
  38. %    for LaTeX version 2.09
  39. % Copyright (C) 1988,1993 by Johannes Braams, Dr Neher Laboratories
  40. %    This style option defines the subeqnarray and subeqnarray*
  41. %    environment, which behaves like the eqnarray environment,
  42. %    except that the lines are numbered like 1a 1b 1c etc.
  43. %    To refer to these numbers an extra label command \slabel
  44. %    has been defined.
  45. %    Many of this code was taken from LaTeX.TeX and modified for
  46. %    this purpose.
  47. %\changes{22/12/88}{1.1}{Fixed bug in subeqnarray* environment}
  48. %\makeshortverb`\|
  49. %    \begin{macrocode}
  50. \def\fileversion{2.0}
  51. \def\filedate{02 November 1993}
  52. \def\docdate{22/12/1988}
  53. \wlog{Style option `subeqnarray' version \fileversion\space<\filedate> (JLB)}
  54. \wlog{English documentation\space\space\space<\docdate> (JLB)}
  55. %    \end{macrocode}
  56. %    A new counter for the subequations
  57. %    and a command to generate the number
  58. %    \begin{macrocode}
  59. \newcounter{subequation}[equation]
  60. \def\thesubequation{\theequation\@alph\c@subequation}
  61. %    \end{macrocode}
  62. %  |\@subeqnnum=|: Produces the equation number for the
  63. %     subeqnarray environment.  The following definition is for
  64. %     flushright numbers; for flushleft numbers, see leqno.doc.
  65. %     The {|\rm ...| } puts the subequation number in roman type even if
  66. %     an subeqnarray environment appears in an italic environment.
  67. %\changes{2.0}{2/11/93}{Added test for presence of the leqno option}
  68. %    \begin{macrocode}
  69. \ifx\ds@leqno\undefined
  70.   \def\@subeqnnum{{\reset@font\rm (\thesubequation)}}
  71. \else
  72.   \def\@subeqnnum{\hbox to .01\p@{}\rlap{\reset@font\rm
  73.         \hskip -\displaywidth(\thesubequation)}}
  74. %    \end{macrocode}
  75. %    A new label command to refer to subequations. It works
  76. %    like the |\label| command and was taken from \LaTeX.TeX
  77. %  |\slabel{FOO}| then writes the following on file |\@auxout| :
  78. %        |\newlabel{FOO}{{eval(\@currentlabel)}{eval(\thepage)}}|
  79. %    \begin{macrocode}
  80. \def\slabel#1{\@bsphack\if@filesw {\let\thepage\relax
  81.    \def\protect{\noexpand\noexpand\noexpand}%
  82.    \edef\@tempa{\write\@auxout{\string
  83.       \newlabel{#1}{{\thesubequation}{\thepage}}}}%
  84.    \expandafter}\@tempa
  85.    \if@nobreak \ifvmode\nobreak\fi\fi\fi\@esphack}
  86. %    \end{macrocode}
  87. %    Here's the subeqnarray environment,
  88. %        it steps the equation counter,
  89. %        sets the subequation counter equal to 1
  90. %        and behaves much like the eqnarray environment.
  91. %\changes{2.0}{2/11/93}{Added test for presence of fleqn style option}
  92. %    \begin{macrocode}
  93. \ifx\ds@fleqn\undefined
  94.   \def\subeqnarray{%
  95.     \stepcounter{equation}%
  96.     \let\@currentlabel=\theequation
  97.     \global\c@subequation\@ne
  98.     \global\@eqnswtrue\m@th
  99.     \global\@eqcnt\z@\tabskip\@centering\let\\\@subeqncr
  100.     $$\m@th\halign to \displaywidth
  101.      \bgroup\@eqnsel\hskip\@centering
  102.       $\displaystyle\tabskip\z@{##}$%
  103.       &\global\@eqcnt\@ne \hskip 2\arraycolsep \hfil${##}$\hfil
  104.       &\global\@eqcnt\tw@ \hskip 2\arraycolsep
  105.          $\displaystyle\tabskip\z@{##}$\hfil \tabskip\@centering
  106.       &\llap{##}\tabskip\z@\cr}
  107. \else
  108.   \def\subeqnarray{%
  109.     \stepcounter{equation}%
  110.     \let\@currentlabel=\theequation
  111.     \global\c@subequation\@ne
  112.     \global\@eqnswtrue\m@th
  113.     \global\@eqcnt\z@\tabskip\mathindent\let\\\@subeqncr
  114.     \abovedisplayskip\topsep
  115.     \ifvmode\advance\abovedisplayskip\partopsep\fi
  116.     \belowdisplayskip\abovedisplayskip
  117.     \belowdisplayshortskip\abovedisplayskip
  118.     \abovedisplayshortskip\abovedisplayskip
  119.     $$\m@th\halign to \linewidth
  120.      \bgroup\@eqnsel\hskip\@centering
  121.       $\displaystyle\tabskip\z@{##}$%
  122.       &\global\@eqcnt\@ne \hskip 2\arraycolsep \hfil${##}$\hfil
  123.       &\global\@eqcnt\tw@ \hskip 2\arraycolsep
  124.          $\displaystyle{##}$\hfil \tabskip\@centering
  125.       &\llap{##}\tabskip\z@\cr}
  126. \def\endsubeqnarray{\@@subeqncr\egroup
  127.                      $$\global\@ignoretrue}
  128. \def\@subeqncr{{\ifnum0=`}\fi\@ifstar{\global\@eqpen\@M
  129.     \@ysubeqncr}{\global\@eqpen\interdisplaylinepenalty \@ysubeqncr}}
  130. \def\@ysubeqncr{\@ifnextchar [{\@xsubeqncr}{\@xsubeqncr[\z@]}}
  131. \def\@xsubeqncr[#1]{\ifnum0=`{\fi}\@@subeqncr
  132.    \noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}}
  133. \def\@@subeqncr{\let\@tempa\relax
  134.     \ifcase\@eqcnt \def\@tempa{& & &}\or \def\@tempa{& &}
  135.       \else \def\@tempa{&}\fi
  136.      \@tempa \if@eqnsw\@subeqnnum\refstepcounter{subequation}\fi
  137.      \global\@eqnswtrue\global\@eqcnt\z@\cr}
  138. %    \end{macrocode}
  139. % Here's the subeqnarray* environment:
  140. %    \begin{macrocode}
  141. \let\@ssubeqncr=\@subeqncr
  142. \@namedef{subeqnarray*}{\def\@subeqncr{\nonumber\@ssubeqncr}\subeqnarray}
  143. \@namedef{endsubeqnarray*}{\global\advance\c@equation\m@ne%
  144.                            \nonumber\endsubeqnarray}
  145. %    \end{macrocode}
  146. \endinput
  147. %% \CharacterTable
  148. %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
  149. %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
  150. %%   Digits        \0\1\2\3\4\5\6\7\8\9
  151. %%   Exclamation   \!     Double quote  \"     Hash (number) \#
  152. %%   Dollar        \$     Percent       \%     Ampersand     \&
  153. %%   Acute accent  \'     Left paren    \(     Right paren   \)
  154. %%   Asterisk      \*     Plus          \+     Comma         \,
  155. %%   Minus         \-     Point         \.     Solidus       \/
  156. %%   Colon         \:     Semicolon     \;     Less than     \<
  157. %%   Equals        \=     Greater than  \>     Question mark \?
  158. %%   Commercial at \@     Left bracket  \[     Backslash     \\
  159. %%   Right bracket \]     Circumflex    \^     Underscore    \_
  160. %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
  161. %%   Right brace   \}     Tilde         \~}
  162.